- /* slfeulnm.cpp by K.Tsuru */
- // function ID 4101 DRADIX
- /****************************************************************
- SLong class
- It provides a n-th Euler's number En by use of combination number.
- *****************************************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- SLong EulerNum(uint N)
- {
- if(N < 2) return 1;
- uint j, m;
- SLong sum, f;
- if(N >= f.Radix()/2u) f.SetError(f.OUT_OF_RANGE,"EulerNum", 4101);
- SLong* E = new SLong[N + 1];
-
- E[0].SetLong(1);
- for(m = 1; m <= N; m++){
- sum.SetZero(); // = 0.0;
- for(j=1; j <= m ; j++){
- f = combL(2*m, 2*j)*E[m-j];
- if(j & 1) sum += f;
- else sum -= f;
- }
- E[m]=sum;
- }
- delete[] E;
- return sum;
- }
slfeulnm.cpp : last modifiled at 2016/10/10 11:05:52(744 bytes)
created at 2017/10/07 10:26:50
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).